-- GENERATED SPELL FOR [Balgaras the Foul] --


function spell0_1364(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(11831,pUnit)
pUnit:RegisterEvent('Sorts_1364', 8281, 1)
end

function spell1_1364(pUnit, Event) --@Shadow Bolt Volley,n/a--
pUnit:FullCastSpellOnTarget(9081,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1364', 3000, 1)
end

function spell2_1364(pUnit, Event) --@Summon Voidwalker,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(12746,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_1364', 1, 1)
end

function spell3_1364(pUnit, Event) --@Volatile Infection,n/a--
pUnit:FullCastSpellOnTarget(3586,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1364', 2000, 1)
end

function Sorts_1364(pUnit, Event)
local choix_sorts_1364 = math.random(0, 3)
if choix_sorts_1364 == 0 then
pUnit:RegisterEvent('spell0_1364', 1, 1)
end
if choix_sorts_1364 == 1 then
pUnit:RegisterEvent('spell1_1364', 1, 1)
end
if choix_sorts_1364 == 2 then
pUnit:RegisterEvent('spell2_1364', 1, 1)
end
if choix_sorts_1364 == 3 then
pUnit:RegisterEvent('spell3_1364', 1, 1)
end
end

function mob1364_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_1364', math.random(1500, 3000), 1)
end

function mob1364_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1364_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1364_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(1364, 1, 'mob1364_Action')
RegisterUnitEvent(1364, 2, 'mob1364_Leave')
RegisterUnitEvent(1364, 3, 'mob1364_Kill')
RegisterUnitEvent(1364, 4, 'mob1364_Die')
